package com.lwz.laboratory.service;


import com.lwz.laboratory.dao.DepartmentMapper;
import com.lwz.laboratory.entity.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;

    public List<Department> getAlldep(String departmentname){
        return departmentMapper.getDepList(departmentname);

    }

    public Department getonedep(Integer id){
        return departmentMapper.selectByPrimaryKey(id);

    }

    public void Adddep(Department department){
        departmentMapper.insertSelective(department);

    }

    public void Updatedep(Department department){
        departmentMapper.updateByPrimaryKeySelective(department);

    }

    public void Deldep(Integer id){
        departmentMapper.deleteByPrimaryKey(id);

    }
}
